package com.ftg.learn.chapter11.annotation;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 布衣
 */
public class Play {

    public static void main(String[] args) {
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("base/spring1.xml");
        ProductEntity productEntity = (ProductEntity) beanFactory.getBean("pro");
        ProductEntity productEntity1 = (ProductEntity) beanFactory.getBean("pro");
        ProductEntity productEntity2 = (ProductEntity) beanFactory.getBean("pro");

        productEntity1.setName("桃子");

        System.out.println(productEntity.getName());
        System.out.println(productEntity1.getName());
        System.out.println(productEntity2.getName());
    }

}
